
<div id="sku-builder">

    <div id="module-specs">

    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">批量填充：</label>

        <div class="form-group col-sm-3">
            <div class="input-group m-b"><span class="input-group-addon">市场价:</span>
                <input class="form-control" type="text" id="market-price" placeholder="请输入销售价格" data-name="market_price"
                       data-action="batch">
            </div>
        </div>
        <div class="form-group col-sm-1"></div>
        <div class="form-group col-sm-3">
            <div class="input-group m-b"><span class="input-group-addon">销售价:</span>
                <input class="form-control" type="text" id="all-price" placeholder="请输入销售价格" data-name="sell_price"
                       data-action="batch">
            </div>
        </div>
        <div class="form-group col-sm-1"></div>
        <div class="form-group col-sm-2">
            <div class="input-group m-b"><span class="input-group-addon">数量:</span>
                <input class="form-control" type="text" id="all-quantity" placeholder="请输入数量" data-name="store_nums"
                       data-action="batch">
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="col-sm-2 control-label">产品列表：</label>
        <div class="col-sm-10">
            <table class="table table-bordered" id="sku-table">
                <thead>
                <tr>
                    <!--规格-->
                    <th>市场价</th>
                    <th>销售价</th>
                    <th>数量</th>
                    <th>SKU</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <!--数据列表-->
                </tbody>
            </table>
        </div>
    </div>

</div>

<script type="text/html" id="template-spec">
    <div class="col-sm-4 col-md-3 col-lg-3">
        <label>
            <input type="checkbox" value="{#id#}" name="spec_id_{#sid#}[]" data-uuid="{#sid#}-{#id#}" icheck-name="spec_{#sid#}_{#id#}" {#checked#}>
            {#block#}
        </label>
    </div>
</script>

<script type="text/html" id="template-spec-list">
    <div class="form-group">
        <label class="col-sm-2 control-label">{#label#}:</label>
        <div class="col-sm-10" id="spec-list-{#id#}">
            {#html#}
        </div>
    </div>
</script>

<script type="text/html" id="template-sku-tr">
    <td><input type="text" data-name="market_price" data-action="save" value="{#market_price#}" name="_spec[{#index#}][market_price]"></td>
    <td>
        <input type="hidden" data-name="id" data-action="save" value="{#id#}" name="_spec[{#index#}][id]">
        <input type="hidden" data-name="specID" data-action="save" value="{#spec#}" name="_spec[{#index#}][specID]">

        <input type="text" data-name="sell_price" data-action="save" value="{#sell_price#}" name="_spec[{#index#}][sell_price]"></td>
    <td><input type="text" data-name="store_nums" data-action="save" value="{#store_nums#}" name="_spec[{#index#}][store_nums]"></td>
    <td><input type="text" data-name="code" data-action="save" value="{#sku#}" name="_spec[{#index#}][sku]"></td>
    <td>
        {{--<input type="text" value="{#is_show#}" readonly style="border:none; color:#a10000" name="_spec[{#index#}][is_show]" data-action="is_show">--}}
        <a><i class="fa switch {#switch_class#}" title="切换状态">
                <input type="hidden" value="{#is_show#}" name="_spec[{#index#}][is_show]">
            </i>
        </a>
    </td>
</script>

<script type="text/html" id="template-img-table">
    <label class="col-sm-2 control-label">颜色图片:</label>
    <div class="col-sm-10">
        <table class="table table-bordered" id="image-table">
            <thead>
            <tr>
                <th style="width: 30%">颜色分类</th>
                <th style="width: 30%">自定义名称</th>
                <th>图片</th>
            </tr>
            </thead>
            <tbody>
            <!--自由填充-->
            </tbody>
        </table>
    </div>
</script>

<script type="text/html" id="template-img-tr">
    <tr data-id="{#id#}" data-sid="{#sid#}">
        <td>
            {#block#}
        </td>
        <td>
            <input type="text" data-id="{#id#}" data-sid="{#sid#}" data-action="update" value="{#alias#}" name="spec_alias[{#id#}]" />
        </td>
        <td class="image">
            <div class="block{#class#}">{#imgTag#}</div>
            <label class="block img-plus">
                <span class="glyphicon glyphicon-plus"></span>
                <input type="file" name="upload_image" accept="image/*">
            </label>
        </td>
    </tr>
</script>